home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / gencodec / source / mb_inline.c < prev    next >
C/C++ Source or Header  |  1999-01-01  |  3KB  |  113 lines

  1. #ifndef _INLINE__MUIB_H
  2. #define _INLINE__MUIB_H
  3.  
  4. #ifndef _SYS_CDEFS_H_
  5. #include <sys/cdefs.h>
  6. #endif
  7. #ifndef _INLINE_STUBS_H_
  8. #include <inline/stubs.h>
  9. #endif
  10.  
  11. __BEGIN_DECLS
  12.  
  13. #ifndef BASE_EXT_DECL
  14. #define BASE_EXT_DECL
  15. #define BASE_EXT_DECL0 extern struct Library *MUIBBase;
  16. #endif
  17. #ifndef BASE_PAR_DECL
  18. #define BASE_PAR_DECL
  19. #define BASE_PAR_DECL0 void
  20. #endif
  21. #ifndef BASE_NAME
  22. #define BASE_NAME MUIBBase
  23. #endif
  24.  
  25. BASE_EXT_DECL0
  26.  
  27. __inline void
  28. MB_Close (BASE_PAR_DECL0)
  29. {
  30.     BASE_EXT_DECL
  31.     register struct Library *a6 __asm("a6") = BASE_NAME;
  32.     __asm __volatile ("jsr a6@(-0x24)"
  33.     : /* No Output */
  34.     : "r" (a6)
  35.     : "d0", "d1", "a0", "a1");
  36. }
  37. __inline void
  38. MB_GetA (BASE_PAR_DECL struct TagItem * TagList)
  39. {
  40.     BASE_EXT_DECL
  41.     register struct Library *a6 __asm("a6") = BASE_NAME;
  42.     register struct TagItem * a1 __asm("a1") = TagList;
  43.     __asm __volatile ("jsr a6@(-0x2a)"
  44.     : /* No Output */
  45.     : "r" (a6), "r" (a1)
  46.     : "d0", "d1", "a0", "a1");
  47. }
  48. void MB_Get (Tag tag1, ...)
  49. {
  50.  MB_GetA((struct TagItem *) &tag1);
  51. }
  52. __inline void
  53. MB_GetNextCode (BASE_PAR_DECL ULONG* type, char ** code)
  54. {
  55.     BASE_EXT_DECL
  56.     register struct Library *a6 __asm("a6") = BASE_NAME;
  57.     register ULONG* a0 __asm("a0") = type;
  58.     register char ** a1 __asm("a1") = code;
  59.     __asm __volatile ("jsr a6@(-0x36)"
  60.     : /* No Output */
  61.     : "r" (a6), "r" (a0), "r" (a1)
  62.     : "d0", "d1", "a0", "a1");
  63. }
  64. __inline void
  65. MB_GetNextNotify (BASE_PAR_DECL ULONG* type, char ** code)
  66. {
  67.     BASE_EXT_DECL
  68.     register struct Library *a6 __asm("a6") = BASE_NAME;
  69.     register ULONG* a0 __asm("a0") = type;
  70.     register char ** a1 __asm("a1") = code;
  71.     __asm __volatile ("jsr a6@(-0x3c)"
  72.     : /* No Output */
  73.     : "r" (a6), "r" (a0), "r" (a1)
  74.     : "d0", "d1", "a0", "a1");
  75. }
  76. __inline void
  77. MB_GetVarInfoA (BASE_PAR_DECL ULONG varnb, struct TagItem * TagList)
  78. {
  79.     BASE_EXT_DECL
  80.     register struct Library *a6 __asm("a6") = BASE_NAME;
  81.     register ULONG d0 __asm("d0") = varnb;
  82.     register struct TagItem * a1 __asm("a1") = TagList;
  83.     __asm __volatile ("jsr a6@(-0x30)"
  84.     : /* No Output */
  85.     : "r" (a6), "r" (d0), "r" (a1)
  86.     : "d0", "d1", "a0", "a1");
  87. }
  88. void MB_GetVarInfo (ULONG varnb, Tag tag1, ...)
  89. {
  90.  MB_GetVarInfoA(varnb, (struct TagItem *) &tag1);
  91. }
  92. __inline BOOL
  93. MB_Open (BASE_PAR_DECL0)
  94. {
  95.     BASE_EXT_DECL
  96.     register res __asm("d0");
  97.     register struct Library *a6 __asm("a6") = BASE_NAME;
  98.     __asm __volatile ("jsr a6@(-0x1e)"
  99.     : "=r" (res)
  100.     : "r" (a6)
  101.     : "d0", "d1", "a0", "a1");
  102.     return res;
  103. }
  104. #undef BASE_EXT_DECL
  105. #undef BASE_EXT_DECL0
  106. #undef BASE_PAR_DECL
  107. #undef BASE_PAR_DECL0
  108. #undef BASE_NAME
  109.  
  110. __END_DECLS
  111.  
  112. #endif /* _INLINE__MUIB_H */
  113.